package com.binance.masterelection.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

import com.binance.masterelection.condition.SpringCloudCondition;
import com.binance.masterelection.service.MasterElection;

@Configuration
@ConditionalOnClass(EnableDiscoveryClient.class)
@Conditional(SpringCloudCondition.class)
public class MasterElectionAutoConfig {


    @Bean
    public MasterElection masterElection() {
        MasterElection masterElection = new MasterElection();
        return masterElection;
    }
}
